//点击按钮回到顶部.
	//获取点击按钮
var retrun_top = document.getElementById("retrun_top");
//console.log(scrollTop);
retrun_top.onclick = function(){
	document.documentElement.scrollTop = 0;
}
//点击按钮回到顶部结束.

//鼠标滑过点击按钮.变色.
$("#retrun_top_ge").hover(function(){
	$(this).css({"background":"green"})
},function(){
	$(this).css({"background":"black"})
})
//进入页面让弹出层出现
$("#popups_bb").animate({"top":"150px"},1000)

//点击关闭按钮让弹出层遮罩层与弹出层消失.
$(".closepopups").click(function(){
	$("#mask").css({display:"none"});
	$("#popups_bb").css({display:"none"});
})
//鼠标滑过显示二级菜单.

$("#menu_1 li").bind("mouseenter",function(){
	$(this).children("div").css({"z-index":666}).stop().fadeIn()
}).bind("mouseleave",function(){
	$(this).children("div").stop().fadeOut()
})
//轮播
class Solid{
	constructor(){
		//获取span.
		 this.spans = document.getElementsByClassName("lunbo");
		 //console.log(this.spans)
		//获取ul
		 this.oUl = document.getElementsByClassName("solid_body");
		 //console.log(this.oUl);
		 this.oSpan = Array.from(this.spans);
		 this.ps = document.getElementsByClassName("lv");
		 this.oP = Array.from(this.ps)
		 //console.log(this.oSpan);
		 this.mouseover();
		 //console.log(this.oP);
		 
	}
	mouseover(){
//		for(var i in this.oSpan){
//			console.log(i);
//		}
		var that = this;
		this.oSpan.forEach(function(value,index){
			//that.index = index;
			//console.log(value);
			//console.log(that.index);
			//console.log();
			value.ind = index;
			//console.log(value.ind);
			value.onmouseover = function(){
				
				//console.log(that.oUl);
				//console.log(value.ind);
			//改变left值
				that.oUl[0].style.left=-960 * value.ind +"px";
				//console.log(this.ind);
//				console.log(value.offsetWidth);
			//划入的时候让span高度增加10.margin-top给负值就能反向增大.
			this.style.height = 50 + "px";
			this.style.marginTop = -10 + "px";
			//滑过谁让谁的p标签显示出来
			that.oP[value.ind].style.display = "block";
			//滑过哪个让哪个span的透明变成100;
			//this.style.opcity = 1;
			}
			//移出事件.
			value.onmouseout = function(){
				this.style.height = 40 + "px";
				this.style.marginTop = 0;
				that.oP[value.ind].style.display = "none";
			}
		})
	}
}
new Solid();

//特惠专区的选项卡开始.

//获取tab.（切换器）
//var $tab = $(".y1");
////获取选项卡内容.
//var $tab_nr = $(".y1_1");
////console.log($tab_nr);
////特惠专区的选项卡结束.
//$tab_nr.addClass("hide");
//$tab_nr.eq(0).removeClass("hide").addClass("show");
////选项卡动画.
//
//$tab.mouseover(function(){
//	var $index = $(this).index();
//	console.log($tab_nr);
//	$tab_nr.eq($index).removeClass("hide").addClass("show").addClass("hide");
//})
